package com.Thread常用API.取名字;

import lombok.SneakyThrows;

public class ThreadDemo02 extends Thread{
    @SneakyThrows//异常注解
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(i);
            if (i==4){
                Thread.sleep(3000);//休息三秒
            }
        }
    }

    public static void main(String[] args) {

        ThreadDemo02 threadDemo02 = new ThreadDemo02();
        threadDemo02.start();

    }
}
